<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    
    function from(){
        this.send = function(toObj, msg){
            console.log("你好，" + toObj.name + "，这是我送你的" + msg);
        }
    }

    function to(n){
        this.name = n;
    }

    function courier(){
        const f = new from();
        this.message = [];
        this.send = function(toObj, msg){

            this.message.push({
                from:f,
                to:t,
                msg:msg,
                time:Date.now()
            })

            // msg = "三年高考五年模拟"

            f.send(toObj, msg);
        }
    }
    
    
    const t = new to("张三");
    const c = new courier();

    c.send(t, "价值1百万的货");

    console.log(c.message);

</script>
</html>